package com.aplink.generic.pojo.controlspec;

import com.aplink.generic.util.AndroidUIParser;

import java.util.ArrayList;
import java.util.List;

public class MenuSpec extends ControlSpec {
    private List<MenuSpec.MenuItem> mMenuItems;

    public MenuSpec() {
        this.mMenuItems = new ArrayList<MenuSpec.MenuItem>();
    }

    public MenuSpec( List<MenuItem> menuItems ) {
        super();
        this.mMenuItems = menuItems;
    }

    public List<MenuSpec.MenuItem> getMenuItems() {
        return this.mMenuItems;
    }

    public void setMenuItems( List<MenuSpec.MenuItem> menuItems ) {
        this.mMenuItems = menuItems;
    }

    public void add( MenuItem menuItem ) {
        mMenuItems.add( menuItem );
    }

    public class MenuItem {
        private String mId;
        private String mValGroupToValidate;

        public String getId() {
            return this.mId;
        }

        public int getIdValue() {
            return AndroidUIParser.getViewIdByName( this.mId );
        }

        public String getValidationgroup() {
            return this.mValGroupToValidate;
        }

        public void setId( String id ) {
            this.mId = id;
        }

        public void setValidationgroup( String valGroupToValidate ) {
            this.mValGroupToValidate = valGroupToValidate;
        }
    }

}
